home *** CD-ROM | disk | FTP | other *** search
/ Menu Planner / Menu Planner (Ohio Distinctive Software).ISO / pc / mp.dir / 00036_meals.ls < prev    next >
Encoding:
Text File  |  1995-11-07  |  1.1 KB  |  49 lines

  1. on keyDown
  2.   global gDirty
  3.   set gDirty to 1
  4.   if the key = TAB then
  5.     if validatePDCScreen() then
  6.       if the machineType = 256 then
  7.         set the editableText of sprite 20 to 1
  8.         hilite field "calories"
  9.       else
  10.         pass()
  11.       end if
  12.     end if
  13.   else
  14.     if the key = BACKSPACE then
  15.       put EMPTY into field "meals"
  16.     else
  17.       if (charToNum(the key) > charToNum("3")) or (charToNum(the key) < charToNum("2")) then
  18.         dontPassEvent()
  19.       else
  20.         if (length(the text of field "meals") >= 1) and (the selection = EMPTY) then
  21.           dontPassEvent()
  22.         else
  23.           if (charToNum(the key) < charToNum("4")) or (charToNum(the key) > charToNum("1")) then
  24.             pass()
  25.           end if
  26.         end if
  27.       end if
  28.     end if
  29.   end if
  30. end
  31.  
  32. on keyUp
  33.   global calcdata
  34.   if field "meals" = "2" then
  35.     tell the stage
  36.       doTwoMeals()
  37.     end tell
  38.     setaProp(calcdata, #twoMeals, 1)
  39.   else
  40.     if field "meals" = "3" then
  41.       tell the stage
  42.         doThreeMeals()
  43.       end tell
  44.       setaProp(calcdata, #twoMeals, 0)
  45.     end if
  46.   end if
  47.   pass()
  48. end
  49.